#include <2025Linux.h>
int main(int argc, char *argv[])
{
    int fds[2];
    pipe(fds);
    if(fork()){
        close(fds[1]);
        char buf[4096];
        while(1){
            read(fds[0],buf,2048);
            printf("after read!\n");
            sleep(1);
        }
        wait(NULL);
    }
    else{
        close(fds[0]);
        char buf[4096];
        int cnt = 0;
        while(1){
            write(fds[1],buf,4096);
            printf("cnt = %d\n", cnt++);
        }
        exit(0);
    }
    return 0;
}

